package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.ticket.sass.common.entity.tenant.enums.TakeTicketStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2024-05-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("take_tickets")
@ApiModel(value="TakeTicketsEntity对象", description="")
public class TakeTicketEntity implements Serializable {
    @ApiModelProperty(value = "取票信息ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "二维码")
    private String qrCode;

    @ApiModelProperty(value = "入场码")
    private String enterCode;

    @ApiModelProperty(value = "检票时间")
    private LocalDateTime checkedAt;

    @ApiModelProperty(value = "票号")
    private String ticketCode;

    @ApiModelProperty(value = "座位编码")
    private String seatCode;

    @ApiModelProperty(value = "座位号")
    private String seat;

    @ApiModelProperty(value = "座位列号")
    private String seatCol;

    @ApiModelProperty(value = "座位行号")
    private String seatRow;

    @ApiModelProperty(value = "票价")
    private BigDecimal price;

    @ApiModelProperty(value = "服务费")
    private BigDecimal service;

    @ApiModelProperty(value = "票状态：0 未检票，1 已检票")
    private TakeTicketStatus status;

    @ApiModelProperty(value = "票订单ID")
    private Long orderId;

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "影院ID")
    private Long cinemaId;

    @ApiModelProperty(value = "租户ID")
    private Long tenantId;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;

    @TableField(exist = false)
    private TakeTicketOrderEntity ticketOrder;
}
